﻿using UnityEditor;
using UnityEngine;
using UnityTouchTable.Runtime;

namespace UnityTouchTable.Editor
{
    [CustomEditor(typeof(TouchTableListener), true)]
    [CanEditMultipleObjects]
    public class TouchTableListenerEditor : TouchTableInspector
    {
        #region Field
        private TouchTableListener m_TouchTableListener;

        private SerializedProperty m_Entry;
        #endregion

        #region Function
        private void OnEnable()
        {
            this.m_TouchTableListener = this.serializedObject.targetObject as TouchTableListener;

            this.m_Entry = this.serializedObject.FindProperty("m_Entry");
        }

        public override void OnInspectorGUI()
        {
            this.serializedObject.Update();

            EditorGUILayout.HelpBox("此脚本只在UnityTouchTableEntry处理模式的自定义中使用", MessageType.Warning);
            EditorGUILayout.PropertyField(this.m_Entry, new GUIContent("入口"));

            this.serializedObject.ApplyModifiedProperties();
        }
        #endregion
    }
}